home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / pvm34b3.zip / pvm34b3 / pvm3 / tracer / trctype.h < prev    next >
C/C++ Source or Header  |  1997-07-22  |  5KB  |  259 lines

  1.  
  2. /* $Id: trctype.h,v 4.2 1997/05/22 18:22:25 pvmsrc Exp $ */
  3.  
  4. /*
  5.  *         Tracer version 1.0:  A Trace File Generator for PVM
  6.  *           Oak Ridge National Laboratory, Oak Ridge TN.
  7.  *           Authors:  James Arthur Kohl and G. A. Geist
  8.  *                   (C) 1994 All Rights Reserved
  9.  *
  10.  *                              NOTICE
  11.  *
  12.  * Permission to use, copy, modify, and distribute this software and
  13.  * its documentation for any purpose and without fee is hereby granted
  14.  * provided that the above copyright notice appear in all copies and
  15.  * that both the copyright notice and this permission notice appear
  16.  * in supporting documentation.
  17.  *
  18.  * Neither the Institution, Oak Ridge National Laboratory, nor the
  19.  * Authors make any representations about the suitability of this
  20.  * software for any purpose.  This software is provided ``as is''
  21.  * without express or implied warranty.
  22.  *
  23.  * Tracer was funded by the U.S. Department of Energy.
  24.  */
  25.  
  26.  
  27. /* Host Name Macros */
  28.  
  29. #define TRC_LOCALHOST( _name ) \
  30. \
  31.     ( TRC_HOST_NAME != NULL && TRC_HOST_ALIAS != NULL \
  32.         && ( !strcmp( TRC_HOST_NAME, _name ) \
  33.             || !strcmp( TRC_HOST_ALIAS, _name ) \
  34.              || ( TRC_TMP_HOST = trc_host_alias_str( _name ), \
  35.                 TRC_TMP_CMP = !strcmp( TRC_HOST_NAME, TRC_TMP_HOST ), \
  36.                 free( TRC_TMP_HOST ), \
  37.                 TRC_TMP_CMP ) ) ) \
  38. \
  39.  
  40. #define TRC_HOST_COMPARE( _host, _name ) \
  41. \
  42.      ( !strcmp( (_host)->name, _name ) \
  43.          || !strcmp( (_host)->alias, _name ) \
  44.          || ( TRC_TMP_HOST = trc_host_alias_str( _name ), \
  45.             TRC_TMP_CMP = !strcmp( (_host)->name, TRC_TMP_HOST ), \
  46.             free( TRC_TMP_HOST ), \
  47.             TRC_TMP_CMP ) ) \
  48. \
  49.  
  50.  
  51. /* Group Task Check Macro */
  52.  
  53. #define TRC_GROUPTASK( _name ) \
  54.     ( trc_compare( "pvmg", _name ) || trc_compare( "pvmcg", _name ) )
  55.  
  56.  
  57. /* Trace Event Record Access Macros */
  58.  
  59. #define TRC_GET_TEVREC( _tr, _trptr, _did ) \
  60. \
  61.     if ( (_trptr = trc_get_tevrec( _tr, _did )) == NULL ) \
  62.         return \
  63. \
  64.  
  65. #define TRC_GET_TEVREC_VALUE( _tr, _did, _dtype ) \
  66. \
  67.     ( (TRC_TMP_TR = trc_get_tevrec( _tr, _did )) != NULL ? \
  68.         TRC_VALUE_OF( TRC_TMP_TR->value, _dtype ) : (_dtype) -1 ) \
  69. \
  70.  
  71. #define TRC_ARR_VALUE_OF( _ptr, _dtype, _index ) \
  72.     ( ((_dtype *) (_ptr))[_index] )
  73.  
  74. #define TRC_VALUE_OF( _ptr, _dtype )    ( *( (_dtype *) (_ptr) ) )
  75.  
  76.  
  77. /* Host Life Status Constants */
  78.  
  79. #define TRC_NOT_IN_PVM    0
  80. #define TRC_IN_PVM        1
  81.  
  82.  
  83. /* TEV Type Constants */
  84.  
  85. #define TRC_ENTRY_TEV    0
  86. #define TRC_EXIT_TEV     1
  87. #define TRC_IGNORE_TEV   2
  88. #define TRC_MAX_TEV      3
  89.  
  90.  
  91. /* Trace Message Status Constants */
  92.  
  93. #define TRC_MSG_STATUS_NONE         0
  94. #define TRC_MSG_STATUS_ACTIVE       1
  95. #define TRC_MSG_STATUS_MORE         2
  96. #define TRC_MSG_STATUS_OVERWRITE    4
  97. #define TRC_MSG_STATUS_CLEANUP      8
  98.  
  99.  
  100. /* General Constants */
  101.  
  102. #define TRC_FALSE    0
  103. #define TRC_TRUE     1
  104.  
  105.  
  106. /* Tracer Data Structures & Types */
  107.  
  108.  
  109. typedef void (*trc_vfp)();
  110.  
  111.  
  112. struct trc_trie_struct
  113. {
  114.     int valid;
  115.     char *str;
  116.     void *value;
  117.     /* TRC_TRIE */ struct trc_trie_struct *next;
  118. };
  119.  
  120. typedef struct trc_trie_struct *TRC_TRIE;
  121.  
  122.  
  123. struct trc_did_struct
  124. {
  125.     int id;
  126.     char *name;
  127.     char *desc;
  128.     /* TRC_DID */ struct trc_did_struct *next;
  129. };
  130.  
  131. typedef struct trc_did_struct *TRC_DID;
  132.  
  133.  
  134. typedef void *TRC_VALUE;
  135.  
  136.  
  137. struct trc_datadesc_struct
  138. {
  139.     TRC_DID did;
  140.     int dt;
  141.     int array;
  142.     TRC_VALUE data;
  143.     int num;
  144.     /* TRC_DATADESC */ struct trc_datadesc_struct *next;
  145. };
  146.  
  147. typedef struct trc_datadesc_struct *TRC_DATADESC;
  148.  
  149.  
  150. struct trc_tevdesc_struct
  151. {
  152.     char *name;
  153.     int eid;
  154.     int entry_exit;
  155.     int index;
  156.     int hid;
  157.     int dump;
  158.     TRC_DATADESC ddesc;
  159.     int refcount;
  160.     /* TRC_TEVDESC */ struct trc_tevdesc_struct *next;
  161. };
  162.  
  163. typedef struct trc_tevdesc_struct *TRC_TEVDESC;
  164.  
  165.  
  166. struct trc_tevdesc_info_struct
  167. {
  168.     int id;
  169.     int dt;
  170.     int array;
  171. };
  172.  
  173. typedef struct trc_tevdesc_info_struct TRC_TEVDESC_INFO_STRUCT;
  174. typedef TRC_TEVDESC_INFO_STRUCT *TRC_TEVDESC_INFO;
  175.  
  176.  
  177. struct trc_tevtask_struct
  178. {
  179.     int tid;
  180.     int tevstatus;
  181.     int outstatus;
  182.     void **tevlist;
  183.     int tevsize;
  184.     char *output;
  185.     /* TRC_TEVTASK */ struct trc_tevtask_struct *next;
  186. };
  187.  
  188. typedef struct trc_tevtask_struct *TRC_TEVTASK;
  189.  
  190.  
  191. struct trc_tevrec_struct
  192. {
  193.     TRC_DATADESC ddesc;
  194.     TRC_VALUE value;
  195.     int num;
  196.     /* TRC_TEVREC */ struct trc_tevrec_struct *next;
  197. };
  198.  
  199. typedef struct trc_tevrec_struct *TRC_TEVREC;
  200.  
  201.  
  202. struct trc_host_struct
  203. {
  204.     char *name;
  205.     char *alias;
  206.     char *refname;
  207.     char *arch;
  208.     struct timeval delta;
  209.     struct timeval last_time;
  210.     int pvmd_tid;
  211.     int speed;
  212.     int in_pvm;
  213.  
  214.     /* Tracing Info */
  215.     void **tevlist;
  216.     int tevsize;
  217.     void **didlist;
  218.     int didsize;
  219.  
  220.     /* Extension Structure for Drawing, Etc. */
  221.     void *ext;
  222.  
  223.     /* TRC_HOST */ struct trc_host_struct *next;
  224. };
  225.  
  226. typedef struct trc_host_struct *TRC_HOST;
  227.  
  228.  
  229. struct trc_id_struct
  230. {
  231.     int complete;
  232.     int group_tasks;
  233.     int event_ctx;
  234.     int event_tag;
  235.     int output_ctx;
  236.     int output_tag;
  237.     TRC_TEVTASK tevtask_list;
  238.     char *trace_file;
  239.     FILE *trace_out;
  240.     FILE *trace_in;
  241.     char *output_file;
  242.     FILE *output_fp;
  243.     trc_vfp status_msg;
  244.     trc_vfp event_dump_hdr;
  245.     trc_vfp output_dump_hdr;
  246.     trc_vfp handle_host_add_notify;
  247.     trc_vfp handle_host_del_notify;
  248.     trc_vfp handle_descriptor;
  249.     trc_vfp handle_old_descriptor;
  250.     trc_vfp handle_event;
  251.     trc_vfp handle_old_event;
  252.     trc_vfp handle_command;
  253.     trc_vfp handle_comment;
  254.     /* TRC_ID */ struct trc_id_struct *next;
  255. };
  256.  
  257. typedef struct trc_id_struct *TRC_ID;
  258.  
  259.